package com.youdianda.controller;


import com.youdianda.result.Result;
import com.youdianda.service.ISysConfigService;
import com.youdianda.vo.BaseInfoVO;
import com.youdianda.vo.ConfigVO;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author mosen
 * @since 2023-05-15
 */
@RestController
@RequestMapping("/index")
@Slf4j
public class SysConfigController {

    @Autowired
    private ISysConfigService iSysConfigService;

    /**获取系统配置*/
    @GetMapping("/getConfig")
    public Result<ConfigVO> getSystemConfig(){
        return iSysConfigService.getSystemConfig();
    }


    /**
     * 获取配置数据
     * @return
     */
    @GetMapping("/all")
    @ApiOperation("获取配置数据")
    public Result getAll(){
        return iSysConfigService.getAll();
    }
    /**主页统计信息*/
    @GetMapping("/baseInfo")
    public Result<BaseInfoVO> getBaseInfo(){
        return iSysConfigService.getBaseInfo();
    }

}
